package com.myoffice.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TRoleinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_ROLEINFO", schema = "OA")
public class TRoleinfo implements java.io.Serializable {

	// Fields

	private String id;
	private String name;
	private String descs;
	private Set<TRolerigth> TRolerigths = new HashSet<TRolerigth>(0);
	private Set<TUserinfo> TUserinfos = new HashSet<TUserinfo>(0);

	// Constructors

	/** default constructor */
	public TRoleinfo() {
	}

	/** minimal constructor */
	public TRoleinfo(String id, String name) {
		this.id = id;
		this.name = name;
	}

	/** full constructor */
	public TRoleinfo(String id, String name, String descs,
			Set<TRolerigth> TRolerigths, Set<TUserinfo> TUserinfos) {
		this.id = id;
		this.name = name;
		this.descs = descs;
		this.TRolerigths = TRolerigths;
		this.TUserinfos = TUserinfos;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "NAME", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DESCS")
	public String getDescs() {
		return this.descs;
	}

	public void setDescs(String descs) {
		this.descs = descs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TRoleinfo")
	public Set<TRolerigth> getTRolerigths() {
		return this.TRolerigths;
	}

	public void setTRolerigths(Set<TRolerigth> TRolerigths) {
		this.TRolerigths = TRolerigths;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TRoleinfo")
	public Set<TUserinfo> getTUserinfos() {
		return this.TUserinfos;
	}

	public void setTUserinfos(Set<TUserinfo> TUserinfos) {
		this.TUserinfos = TUserinfos;
	}

}